package com.heima.wemedia.config;

import com.heima.wemedia.interceptor.UserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author brianxia
 * @version 1.0
 * @date 2022-11-11 15:05
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserInterceptor()).addPathPatterns("/**")
                //对所有请求都生效
            .excludePathPatterns("/login/in");
        //排除登录请求
    }
}
